package com.xinxin.intelligenceexam.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.xinxin.intelligenceexam.R;
import com.xinxin.intelligenceexam.contract.SplashContract;
import com.xinxin.intelligenceexam.presenter.SplashPresenterImpl;

public class SplashActivity extends AppCompatActivity implements SplashContract.View{
private SplashPresenterImpl mSplashPresenter;
    private Context mContext;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);
        mContext = this;
        mSplashPresenter = new SplashPresenterImpl();
        mSplashPresenter.attachView(this);
        //检查是否已经登录过
        //mSplashPresenter.checkLogin();
    }

    @Override
    protected void onResume() {
        super.onResume();
    }

    @Override
    public void gotoRegister() {
        Intent intent = new Intent(this,RegisterActivity.class);
        intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        startActivity(intent);
        finish();
    }

    @Override
    public void gotoLogin() {
        Intent intent = new Intent(this,LoginActivity.class);
        intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        startActivity(intent);
        finish();
    }

    @Override
    public void gotoMain() {
        Intent intent = new Intent(this,MainActivity.class);
        intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        startActivity(intent);
        finish();
    }

    @Override
    public void gotoStudyMenu() {
        Intent intent = new Intent(this,StudyMenuActivity.class);
        intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        startActivity(intent);
        finish();
    }

    @Override
    public void snackBarShow(String msg) {

    }

    @Override
    public void initData() {

    }

    @Override
    public void initView() {

    }
}
